package bufferedStream;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class BufferedInAndOutStream {
	public static void main(String[] args) {
		BufferedInputStream bis=null;
		BufferedOutputStream bos=null;
		try {
			bis=new BufferedInputStream(new FileInputStream("C:/my.bmp"));
			bos=new BufferedOutputStream(new FileOutputStream("E:/my.bmp"));
			int b=0;
			while((b=bis.read())!=-1){
				bos.write(b);
				bos.flush();
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
